﻿using Brjnk.Common;
using Brjnk.Maps;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace MapsTest
{
    [TestClass()]
    public class MercatorProjectionTest
    {
        private TestContext testContextInstance;

        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes

        //
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //

        #endregion Additional test attributes

        [TestMethod()]
        public void ToInternalTest()
        {
            MercatorProjection target = new MercatorProjection();
            GpsCoordinates gps1 = new GpsCoordinates(20, -20);
            GpsCoordinates gps2 = new GpsCoordinates(20, 20);
            GpsCoordinates gps3 = new GpsCoordinates(-20, 20);
            GpsCoordinates gps4 = new GpsCoordinates(-20, -20);
            var actual1 = target.ToInternal(gps1);
            var actual2 = target.ToInternal(gps2);
            var actual3 = target.ToInternal(gps3);
            var actual4 = target.ToInternal(gps4);
            var position = target.ToGpsCoordinates(actual1);

            Assert.AreEqual(position, gps1);

            System.Diagnostics.Debug.WriteLine(actual1.ToString());
            System.Diagnostics.Debug.WriteLine(actual2.ToString());
            System.Diagnostics.Debug.WriteLine(actual3.ToString());
            System.Diagnostics.Debug.WriteLine(actual4.ToString());
        }
    }
}